class InitialSchema < ActiveRecord::Migration
  def self.up
    ActiveRecord::Base.transaction do
      
      create_table :users do |t|
        t.column :screen_name, :string
        t.column :first_name, :string
        t.column :last_name, :string
        t.column :password, :string
        t.column :avatar, :string
        t.column :email, :string
      end
      
      create_table :loughs do |t|
        t.column :name, :string
        t.column :settings, :text
        t.column :user_id, :integer
      end
      
      create_table :articles do |t|
        t.column :title, :string
        t.column :body, :text
        t.column :body_html, :text
        t.column :user_id, :integer
        t.column :lough_id, :integer
        #t.column :published_at, :datetime
        #t.column :published, :boolean
        
        t.timestamps
        
      end
      
    end
  end

  def self.down
    
    ActiveRecord::Base.transaction do
      drop_table :users
      drop_table :loughs
      drop_table :articles
    end
  end
end
